package com.mapaower.admin.exception;

public class BusinessException extends RuntimeException {

    private String errorCode;

    /**
     * 构造函数，仅指定错误消息
     */
    public BusinessException(String message) {
        super(message);
    }

    /**
     * 构造函数，指定错误码和错误消息
     */
    public BusinessException(String errorCode, String message) {
        super(message);
        this.errorCode = errorCode;
    }

    /**
     * 构造函数，指定错误消息和异常原因
     */
    public BusinessException(String message, Throwable cause) {
        super(message, cause);
    }

    /**
     * 构造函数，指定错误码、错误消息和异常原因
     */
    public BusinessException(String errorCode, String message, Throwable cause) {
        super(message, cause);
        this.errorCode = errorCode;
    }

    public String getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }
}